// tableColumns.ts
import type { TableColumnsType } from 'ant-design-vue'
import type { User } from '@/types/api/system/user'

export const useTableColumns = () => {
  const { t } = useI18n()
  
  return computed<TableColumnsType<User>>(() => [
    {
      title: t('user.username'),
      dataIndex: 'username',
      width: 120,
      ellipsis: true
    },
    {
      title: t('user.nickname'),
      dataIndex: 'nickname',
      width: 120,
      ellipsis: true
    },
    {
      title: t('user.email'),
      dataIndex: 'email',
      width: 180,
      ellipsis: true
    },
    {
      title: t('user.phone'),
      dataIndex: 'phone',
      width: 120
    },
    {
      title: t('user.dept'),
      dataIndex: ['dept', 'name'],
      width: 120,
      ellipsis: true
    },
    {
      title: t('user.status'),
      dataIndex: 'status',
      width: 100,
      align: 'center',
      key: 'status'
    },
    {
      title: t('user.createTime'),
      dataIndex: 'createTime',
      width: 180
    },
    {
      title: t('common.action'),
      key: 'action',
      width: 220,
      fixed: 'right'
    }
  ])
} 